﻿using System;
namespace Xtee.Schema {
    
    
    public class XsdInteger : global::Xtee.Schema.XsdDecimal {
        
        public XsdInteger(decimal value) : 
                base(value) {
            this.Validate();
        }
        
        public XsdInteger(string value) : 
                base(value) {
            this.Validate();
        }
        
        public XsdInteger() : 
                base(new decimal()) {
        }
        
        public static bool TryParse(string value, out global::Xtee.Schema.XsdInteger result) {
            try {
                result = new global::Xtee.Schema.XsdInteger(value);
                return true;
            }
            catch (System.Exception ex) {
                result = null;
                return false;
            }
        }
        
        public static implicit operator Decimal (XsdInteger value) {
            return value.Value;
        }
        
        public static implicit operator XsdInteger (decimal value) {
            return new XsdInteger(value);
        }
    }
}
